import React from 'react';
import { Switch } from 'antd';
import { connect } from 'dva';
import { ButtonClass } from '/common/componentsTpl/ButtonComp';

export class SwitchClass extends ButtonClass {

  noAuthRender() {
    const restProps = this.getRestProps();
    return <Switch {...restProps} disabled={true}/>;
  }

  mainRender() {
    const restProps = this.getRestProps();
    return <Switch {...restProps} />;
  }
}

/**
 * 支持 Button 组件的所有属性
 * @type {{actionType: string, appConfigObj: {}}}
 */
SwitchClass.defaultProps = {
  ...ButtonClass.defaultProps,
};

SwitchClass.getConnectData = ButtonClass.getConnectData;

const SwitchComp = connect(SwitchClass.getConnectData)(SwitchClass);

export default SwitchComp;
